const Koa = require('koa');
const cors = require('koa2-cors');
const koaBody = require('koa-body');

const app = new Koa();

const router = require("./router/index");

const koaBodyCon = koaBody({
    multipart: true,
    formidable: {
        maxFileSize: 200 * 1024 * 1024    // 设置上传文件大小最大限制，默认2M
    }
});

app.use(cors()).use(koaBodyCon).use(router.routes());


app.listen(3000, () => {
    console.log("3000服务已启动...");
});